ABC152 D - Handstand 2
提出
TLE
code: python
n = int(input())
pair = {}
for i in range(1, n+1):
for i in range(1, n+1):
for j in range(1, n+1):
if (int(str(i)-1) == int(str(j)0) and int(str(i)0) == int(str(j)-1)): ans = 0
for v in pair.values():
ans += len(v)
print(ans)
解答
code: python
n = int(input())
cnt = dict()
for top in range(10):
for bottom in range(10):
for i in range(1, n + 1):
result = 0
# 先頭が top、末尾が bottom の数が、N 以下にいくつあるのかを数える
for top in range(10):
for bottom in range(10):
print(result)
メモ
提出
code: python
n = int(input())
# (2, 2*2)
# (123, 3*1)
# (123456, 1*6)